package com.baidu.customview.activity;

import android.os.Bundle;

import com.baidu.customview.R;
import com.baidu.customview.adapter.VGAdapter;
import com.baidu.customview.widget.viewgroup.DivideLineGridView;

import java.util.ArrayList;

/**
 * Created by Kvin on 2016/1/7.
 */
public class ViewGroupActivity extends BaseActivity {

    private DivideLineGridView gv;
    private ArrayList<Integer> datas;
    private VGAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.widget_dividelinegridview);
        initView();
    }

    private void initView() {
        this.gv = (DivideLineGridView) findViewById(R.id.gv);
        datas = new ArrayList<>();
        for (int i = 0; i < 21; i++) {
            datas.add(R.mipmap.ic_launcher);
        }
        adapter = new VGAdapter(datas, this);
        this.gv.setAdapter(adapter);
    }
}
